const express = require('express')

const userHandler = require('../router_handle/article_cate')
const router = express.Router()

const expressJoi = require('@escook/express-joi')
const add_cate_schema = require('../schema/article_cate')
const get_cate_schema = require('../schema/article_cate')
const update_cate_scha = require('../schema/article_cate')



//获取分类列表
router.get("/article/cates", userHandler.getArticleCate)

//增加分类列表
router.post('/article/addcates', expressJoi(add_cate_schema), userHandler.addArticleCate)

//根据 Id 获取文章分类
router.get('/article/cates/:id', expressJoi(get_cate_schema), userHandler.getArticleById)


router.post('/article/updatecate', expressJoi(update_cate_scha), userHandler.updateArticleCateById)


//删除分类类别
router.get('/article/deletecate/:id', userHandler.deleteArticleCate)



module.exports = router